package cn.tedu.lucky.draw.server.protocol.po;

import lombok.Getter;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

//@Entity 表示当前的实体类与哪张表进行直接映射，自动将表中的字段名称和实体类中的属性名称一致会自动映射
@Getter
@Entity(name="draw_activity_prize")
public class ActivityPrize {
    /**
     * @Id 表示指定实体类中用于数据映射的主键是谁
     * @GGeneratedValue(strategy = GenerationType.AUTO ) 开启主键自增功能
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY )
    private Long id;
    private Long activityId;
    private Long prizeId;

    public ActivityPrize() {
    }

    public ActivityPrize(Long id, Long activityId, Long prizeId) {
        this.id = id;
        this.activityId = activityId;
        this.prizeId = prizeId;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setActivityId(Long activityId) {
        this.activityId = activityId;
    }

    public void setPrizeId(Long prizeId) {
        this.prizeId = prizeId;
    }

    @Override
    public String toString() {
        return "ActivityPrize{" +
                "id=" + id +
                ", activityId=" + activityId +
                ", prizeId=" + prizeId +
                '}';
    }
}